package com.pig4cloud.pigx.system.api.feign;

import com.pig4cloud.pigx.common.core.constant.SecurityConstants;
import com.pig4cloud.pigx.common.core.constant.ServiceNameConstants;
import com.pig4cloud.pigx.common.core.util.R;
import com.pig4cloud.pigx.system.entity.SystemProduct;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 策略模块-策略-合约feign接口
 *
 * @since 2022/8/28 16:47
 */
@FeignClient(contextId = "systemProductFeign",
        value = ServiceNameConstants.DAPP_SYSTEM_SERVICE,
        path = "/feign/system/product")
public interface SystemProductFeign {

    String GET_BY_ID = "/get-by-id";

    /**
     * 根据id查询产品信息
     *
     * @param productId 产品id
     * @param from      标记系统内部请求
     * @return {@link R< Long>}
     * @since 2022/11/26 14:41
     */
    @GetMapping(GET_BY_ID)
    R<SystemProduct> getById(@RequestParam("id") Long productId, @RequestHeader(SecurityConstants.FROM) String from);
}
